<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link href="../style/authority/basic_layout.css" rel="stylesheet" type="text/css">
	<link href="../style/authority/common_style.css" rel="stylesheet" type="text/css">
	<link href="../style/authority/zTreeStyle.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" href="../style/bootstrap.min.css"/>
	<script type="text/javascript" src="../scripts/jquery/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="../scripts/zTree/jquery.ztree.core-3.2.js"></script>
	<script type="text/javascript" src="../scripts/fancybox/jquery.fancybox-1.3.4.js"></script>
	<script type="text/javascript" src="../scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
	<link rel="stylesheet" type="text/css" href="../style/authority/jquery.fancybox-1.3.4.css" media="screen"/>
	</link>
	<script type="text/javascript" src="../scripts/artDialog/artDialog.js?skin=default"></script>
	<script type="text/javascript" src="../scripts/bootstrap.min.js"></script>
	<script type="text/javascript" src="../scripts/jquery.js"></script>
	<script type="text/javascript" src="../scripts/bootstrap.js"></script>
	<title>信息管理系统</title>

	<style type="text/css">
		#sider {
			position: absolute;
			top: 0;
			left: 25px;
			bottom: 0px;
			width: 260px;
			border: 1px solid #DEDFDF;
		}

		#main {
			position: absolute;
			top: 0;
			left: 285px;
			right: 0px;
			bottom: 0px;
			border: 1px solid #DEDFDF;
			overflow: auto;
		}

		#fang_type li {
			width: 80px;
			height: 22px;
			line-height: 22px;
			color: #FFF;
			display: inline-block;
		}

		li {
			list-style-type: none;
		}
	</style>
</head>

<body>
<div id="container">
	<div id="sider">
		<!--<ul id="tree" class="ztree"></ul>-->
		<div class="tree well ">
			<!--左边树形菜单栏-->
			<ul style="width:280px;">
				<li>
                    <span>
                        <i class="glyphicon glyphicon-option-horizontal"></i>
                        <a href="">
                            打开全部
                        </a>
                    </span>
					<ul>
						<li>
							<i class="glyphicon glyphicon-option-vertical"></i>
							<a href="/plan">计划审批</a>
						</li>
						<li>
							<i class="glyphicon glyphicon-option-vertical"></i>
							<a href="">立项审批</a>
						</li>
						<li>
							<i class="glyphicon glyphicon-option-vertical"></i>
							<a href="">征求意见稿审批</a>
						</li>
						<li>
							<i class="glyphicon glyphicon-option-vertical"></i>
							<a href="">正式稿审批</a>
						</li>
					</ul>
				</li>
			</ul>

		</div>
	</div>
	<div id="main">
		<div>
			<div align="left" style="background-color: #E7E7E7;"><span class="glyphicon glyphicon-play"></span><span
					style="color: #990000;">&nbsp;处理</span></div>
		</div>
		<div>
			<table class="table table-bordered">
				<thead>
				<tr>
					<th class="text-center" width="100px"><input type="checkbox"/></th>
					<th>代办类型</th>
					<th class="text-center">发送人</th>
					<th class="text-center">发送时间</th>
					<th class="text-center">操作</th>
				</tr>
				</thead>
				<tbody id="tb">

				<tr th:each="a:${auditPlanList}" id="ddd">
					<td><input type="checkbox"/></td>
					<td id="names"  th:text="${a.auditPlan.name}">Tanmay</td>
					<td id="namess" th:text="${a.user.name}">Bangalore</td>
					<td id="datess" th:text="${a.auditPlan.creationdate}">560001</td>
					<td>
						<a th:href="@{auditPlanByDel(id=${a.auditPlan.id})}"><input type="button" value="删除" class="ui_input_btn01"/></a>
						<input  data-toggle="modal" th:onclick="|dome(${a.auditPlan.id})|" data-target="#myModal1" type="button" value="更新" class="ui_input_btn01"/>
					</td>
				</tr>


				</tbody>
			</table>

		</div>
	</div>
</div>


















<div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog modal-sm">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">×
				</button>
				<h4 class="modal-title" id="myModalLabel">
					更新
				</h4>
			</div>
			<input type="hidden" id="auditPlanid"  />
			<div class="modal-body">
				<input type="hidden" id="aid"/>
				<input type="hidden" id="acname"/>
				<div class="form-group">
					<label>代办计划</label>
					<input type="text" class="form-control"  id="ajihua" placeholder="请输入属性">
				</div>
				<div class="form-group">
					<label>发送人</label>
					<input type="text" class="form-control"  id="auname" placeholder="请输入属性">
				</div>
				<div class="form-group">
					<label>发送时间</label>
					<input type="text" class="form-control"  id="adata" placeholder="请输入属性">
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" id="qu" class="btn btn-default"
						data-dismiss="modal">关闭
				</button>
				<button type="button"  onclick="upd()" class="btn btn-primary">
					提交更改
				</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</body>
</html>
<script type="text/javascript">

    function dome(data){
        var url="/auditPlanUpdate";
        var params="id="+data;
        $.post(url,params,function (date) {
            var startDate = new Date(date.auditPlan.creationdate).Format("yyyy-MM-dd HH-mm-ss");
            $("#aid").val(date.auditPlan.id)
            $("#acname").val(date.auditPlan.creationname)
            $("#ajihua").val(date.auditPlan.name)
            $("#auname").val(date.user.name)
            $("#adata").val(startDate)

        })
    }


    $("tr").click(function () {
        $(this).attr("class","1").siblings().removeClass('1')

    })

    function upd(){

        var id=$("#aid").val()
        var creationname=$("#acname").val()
        var name=$("#ajihua").val()
        var username=$("#auname").val()
        var date=$("#adata").val()
        var url="/auupd";
        var params = {
            "id":id,
            "creationname":creationname,
            "name":name,
            "username":username,
            "date":date
        }
        $.post(url,params,function (data) {





            $("[class='1'] #names").text(data.auditPlan.name);
            $("[class='1'] #namess").text(data.user.name);
            var startDate = new Date(data.auditPlan.creationdate).Format("yyyy-MM-dd HH-mm-ss");
            $("[class='1'] #datess").text(startDate);


        })
        document.getElementById("qu").click();

    }
    $(function () {
        $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch');
        $('.tree li.parent_li > span').on('click', function (e) {
            var children = $(this).parent('li.parent_li').find(' > ul > li');
            if (children.is(":visible")) {
                children.hide('fast');
                $(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign');
            } else {
                children.show('fast');
                $(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign');
            }
            e.stopPropagation();
        });
    });










    Date.prototype.Format = function(fmt) {
        var o = {
            "M+" : this.getMonth() + 1, //月份
            "d+" : this.getDate(), //日
            "H+" : this.getHours(), //小时
            "m+" : this.getMinutes(), //分
            "s+" : this.getSeconds(), //秒
            "q+" : Math.floor((this.getMonth() + 3) / 3), //季度
            "S" : this.getMilliseconds()
            //毫秒
        };
        if (/(y+)/.test(fmt))
            fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "")
                .substr(4 - RegExp.$1.length));
        for ( var k in o)
            if (new RegExp("(" + k + ")").test(fmt))
                fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k])
                    : (("00" + o[k]).substr(("" + o[k]).length)));
        return fmt;
    }
</script>
<!--
	作者：钟琪
	时间：2019-05-10
	描述：
-->